package com.deer.wms.base.system.service.bill.impl;

import com.deer.wms.base.system.dao.bill.BillInSapMapper;
import com.deer.wms.base.system.model.bill.*;
import com.deer.wms.base.system.model.zh.WorkTasks;
import com.deer.wms.base.system.service.bill.BillInSapService;
import com.deer.wms.common.core.service.AbstractService;
import com.deer.wms.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 李帅辰
 * @date 2021/6/21 16:53
 */
@Service
public class BillInSapServiceImpl extends AbstractService<BillInSap, Integer> implements BillInSapService {

    @Autowired
    private BillInSapMapper billInSapMapper;
    @Override
    public List<BillInSapDto> findBillInSapDtoList(BillInSapCriteria billInSapCriteria) {
        return billInSapMapper.findBillInSapDtoList(billInSapCriteria);
    }

    @Override
    public List<BillInSapDetailDto> findBillInSapDetailList(BillInSapDetailDto billInSapDetailDto) {
        return billInSapMapper.findBillInSapDetailList(billInSapDetailDto);
    }

    @Override
    public List<BillInSap> findBillInSapList(BillInSap billInSap) {
        return billInSapMapper.findBillInSapList(billInSap);
    }

    @Override
    public boolean findBillInSapByvBELN(String vBELN) {
        BillInSap billInSapByvBELN = billInSapMapper.findBillInSapByvBELN(vBELN);
        if (null == billInSapByvBELN || null == billInSapByvBELN.getBillInSapId()){
            return false;
        }
        return true;
    }


    @Override
    public BillInSapDto findBillInSapDtoById(Integer billInSapId) {
        return billInSapMapper.findBillInSapDtoById(billInSapId);
    }

    @Override
    public int updateBillInSap(BillInSap billInSap) {
        return billInSapMapper.updateBillInSap(billInSap);
    }

    @Override
    public BillInSapDto findBillInSapByBillInSapId(Integer billInSapId) {
        return billInSapMapper.findBillInSapByBillInSapId(billInSapId);
    }

    @Override
    public List<BillInSapDetailDto> findBillInSapDetailByBillInSapId(Integer billInSapId) {
        return billInSapMapper.findBillInSapDetailByBillInSapId(billInSapId);
    }

    @Override
    public void updateBillInSapDetail(WorkTasks workTasks) {
        billInSapMapper.updateBillInSapDetail(workTasks);
    }

    @Override
    public void updateBillInSapDetailReceiptState(BillInSapDetail billInSapDetail) {
        billInSapMapper.updateBillInSapDetailReceiptState(billInSapDetail);
    }

    @Override
    public int findBillInSapOver(BillInSapDetail billInSapDetail) {
        return billInSapMapper.findBillInSapOver(billInSapDetail);
    }

    @Override
    public void insertBillInSap(BillInSapDto billInSapDto) {
        billInSapMapper.insertBillInSap(billInSapDto);
    }

    @Override
    public void insertBillInSapDetail(BillInSapDto billInSapDto) {
        billInSapMapper.insertBillInSapDetail(billInSapDto);
    }

    @Override
    public void postingSap(int billInSapId) {
        billInSapMapper.postingSap(billInSapId);
    }

    @Override
    public void postingSapDetail(int billInSapId) {
        billInSapMapper.postingSapDetail(billInSapId);
    }

    @Override
    public void postingMaster(int billInSapId) {
        billInSapMapper.postingMaster(billInSapId);
    }

    @Override
    public List<BillInSapDetail> findSapDetailById(Integer billInSapDetailId) {
        return billInSapMapper.findSapDetailById(billInSapDetailId);
    }

    @Override
    public List<BillInSapDto> findBillInSapDetailById(Integer billId) {
        return billInSapMapper.findBillInSapDetailById(billId);
    }

    @Override
    public BillInSapDetailDto findBillInSapDetailVo(Integer id) {
        return billInSapMapper.findBillInSapDetailVo(id);
    }

    @Override
    public void updateDetailCarryStateById(Integer id) {
        billInSapMapper.updateDetailCarryStateById(id);
    }

    @Override
    public int selectCarryStateCount(Integer id) {
        return billInSapMapper.selectCarryStateCount(id);
    }

    @Override
    public void updateBillInSapState3(Integer id) {
        billInSapMapper.updateBillInSapState3(id);
    }
    @Override
    public void updateBillInSapState2(Integer id) {
        billInSapMapper.updateBillInSapState2(id);
    }

    @Override
    public List<Integer> findStateDetailById(int billInSapId) {
        return billInSapMapper.findStateDetailById(billInSapId);
    }

    @Override
    public void updateBillInMasterState3(int id) {
        billInSapMapper.updateBillInMasterState3(id);
    }

    @Override
    public void updateBillInMasterState2(int id) {
        billInSapMapper.updateBillInMasterState2(id);
    }

    @Override
    public int deleteSapByIds(Integer id) {
        return billInSapMapper.deleteSapByIds(id);
    }

    @Override
    public int deleteSapDetailByIds(Integer id) {
        return billInSapMapper.deleteSapDetailByIds(id);
    }

    @Override
    public int delTaskWork(Integer id) {
        return billInSapMapper.delTaskWork(id);
    }

    @Override
    public int delDetail(Integer id) {
        return billInSapMapper.delDetail(id);
    }

    @Override
    public int delBox(Integer id) {
        return billInSapMapper.delBox(id);
    }

    @Override
    public int delBoxDetail(Integer id) {
        return billInSapMapper.delBoxDetail(id);
    }


}
